package balgo.ga;

/**
 * AdorynZhao in Toutiao-UESTC.
 * Source Code Created on 2017/12/28.
 */
public class TGeneticAlgorithmTest extends TGeneticAlgorithm {

    public static final int NUM = 1 << 24;

    public TGeneticAlgorithmTest() {
        super(24);
    }

    @Override
    public double changeX(TChromosome chrom) {
        return ((1.0 * chrom.getNum() / NUM) * 100) + 6;
    }

    @Override
    public double calculateY(double x) {
        return 100 - Math.log(x);
    }

    public static void main(String[] args) {
        TGeneticAlgorithm test = new TGeneticAlgorithmTest();
        test.calculate();
    }
}
